package org.ucas.kgraph;

import org.apache.log4j.PropertyConfigurator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;

@SpringBootApplication
public class KGraphMain extends SpringBootServletInitializer  {
 
  static {
    String log4jPath= KGraphMain.class.getClassLoader().getResource("").getPath()+"config/log4j.properties";
    PropertyConfigurator.configure(log4jPath);
  }
  
  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
      return application.sources(KGraphMain.class);
  }
  
  public static void main(String[] args) throws Exception {
    SpringApplication.run(KGraphMain.class, args);
  }
}